﻿Language = function()
{

  //This keeps English "private"
  var English = {
    MONDAY     : 'Monday',
    TUESDAY    : 'Tuesday',
	WEDNESDAY  : 'Wednesday',
	THURSDAY   : 'Thursday',
	FRIDAY     : 'Friday',
	SATURDAY   : 'Saturday',
	SUNDAY     : 'Sunday',
	TIMESHEET  : 'Timesheet',
	DIRECTORY  : 'Directory',
	EXPORT     : 'Data Export',
	PROVIDER   : 'Provider'
  };

  var French  = {
    MONDAY     : 'Lundi',
    TUESDAY    : 'Mardi',
	WEDNESDAY  : 'Mercredi',
	THURSDAY   : 'Jeudi',
	FRIDAY     : 'Vendredi',
	SATURDAY   : 'Samedi',
	SUNDAY     : 'Dimanche',
	TIMESHEET  : 'Feuille de temps',
	DIRECTORY  : 'Annuaire',
	EXPORT     : 'Export de données',
	PROVIDER   : 'Fournisseur'
  };
 
  return {
    translate: function(lang,phrase)
    {
	  if ( lang = 'FR' )
	    return French[phrase];
	  else
        return English[phrase];
    }
  };
}();


function language_translate_all () {
	document.getElementById('TIMESHEET_admin').innerHTML = Language.translate(sessionStorage.getItem('theLang'),'TIMESHEET');
	document.getElementById('DIRECTORY_admin').innerHTML = Language.translate(sessionStorage.getItem('theLang'),'DIRECTORY');
	document.getElementById('EXPORT_admin').innerHTML = Language.translate(sessionStorage.getItem('theLang'),'EXPORT');
	document.getElementById('TIMESHEET_empl').innerHTML = Language.translate(sessionStorage.getItem('theLang'),'TIMESHEET');
	document.getElementById('DIRECTORY_empl').innerHTML = Language.translate(sessionStorage.getItem('theLang'),'DIRECTORY');
}

